package no.sachmuld.methodcombination.api.reflection;

import no.sachmuld.methodcombination.api.BehaviourMethod;
import no.sachmuld.methodcombination.api.reflection.component.SimpleMethodCombination;

import java.util.ArrayList;

/**
*
*/
public class List<E> extends SimpleMethodCombination<Object, java.util.List<E>, E> {

    private java.util.List<E> combinedResult = new ArrayList<>();

    @Override
    protected boolean handleSingleResult(E singleResult) {
        combinedResult.add(singleResult);
        return true;
    }

    @Override
    protected java.util.List<E> combinedResult() {
        return combinedResult;
    }

    @Override
    protected void configurePrimaryMethod(BehaviourMethod.Builder builder) {
        builder.unknownReturnType();
    }
}
